<template>
  <div>
    <h1>App</h1>
    <ul>
      <li v-for="item in List" :key="item.id">
        姓名-{{ item.name }}年龄-{{ item.age }}
      </li>
    </ul>
    <List ref="listComp" />
  </div>
</template>

<script>
import _ from "lodash";
import List from "./components";
export default {
  name: "App",
  data() {
    return {
      List: [],
    };
  },
  mounted() {
    this.$refs.listComp.$on("sendData",this.getListData)
  },
  components: {
    List,
  },
  methods: {
    getListData(List) {
      this.List = _.cloneDeep(List);
    },
  },
};
</script>

<style>
</style>